/*
 * @Author: your name
 * @Date: 2022-03-02 15:21:53
 * @LastEditTime: 2022-03-02 15:31:50
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%B属性
 * @FilePath: \JS\day04\8-数据属性.js
 */
var obj={
    name:'wangwu',
    age :12
}

//delete obj.name;
console.log(obj,'删除前可以删除');
//数据属性 name age
//定义或者修改属性可以使用es5的Object.defineProperty
/* Object.defineProperty(目标对象，定义修改属性，{
    configurable:'是否可删除'，
    writable:'可写'
}) */
Object.defineProperty(obj,'name',{
    configurable:false,
    writable:false
});
obj.name='kkkjjpp'
delete obj.name;
console.log(obj,'定义不可删除后');